package com.sender;

import com.sender.R;
import com.sender.service.SenderService;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;



public class SenderActivity extends Activity {
    /** Called when the activity is first created. */
	//private static final String MEDIA_SERVICE = "android.intent.action.MEDIA_BUTTON";
	//private AudioManager audioManager = null; 
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        System.out.println("mainActvity");
        /*
        TriggerReceiver tri = new TriggerReceiver();
        IntentFilter filter = new IntentFilter();
        filter.addAction(MEDIA_SERVICE);
        SenderActivity.this.registerReceiver(tri, filter);
        */
        //setVolumeControlStream(AudioManager.STREAM_MUSIC);  
        Intent intent = new Intent();
        intent.setClass(SenderActivity.this, SenderService.class);
        /*
        
        audioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
        ComponentName cN = new ComponentName(getPackageName(),TriggerReceiver.class.getName());
        // Start listening for button presses 开始 监 听
        audioManager.registerMediaButtonEventReceiver(cN);
         */

     // later somewhere in activity.
     
     
        startService(intent);
        

        
    }
   
    /*
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if(keyCode==KeyEvent.KEYCODE_VOLUME_DOWN){
    	    System.out.println("volumedown");
    	    return true;
    	}
    	else if(keyCode==KeyEvent.KEYCODE_VOLUME_UP){
    	    System.out.println("volumeup");
            return true;
        }
    	else{
    	     return super.onKeyDown(keyCode, event);
    	     }
    }
    */

    
}